import {JSEncrypt} from 'jsencrypt'

class EncryptUtils {

    constructor() {
    }

    static encrypt(password, publicKey) {
        let en = new JSEncrypt();
        en.setPublicKey(publicKey);
        return en.encrypt(password)
    }

    static decrypt(password, privateKey) {
        let jse = new JSEncrypt();
        jse.setPrivateKey(privateKey)
        jse.decrypt(password)
        return password;
    }
}

export default EncryptUtils;